from girls.models import Girl
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponse

def index(request):
    latest_girl_list = Girl.objects.all().order_by('-price_h')[:5]
    return render_to_response('girls/index.html', {'latest_girl_list': latest_girl_list})

def detail(request, girl_id):
    g = get_object_or_404(Girl, pk=girl_id)
    return render_to_response('girls/detail.html', {'girl': g})

def results(request, girl_id):
    return HttpResponse("You're looking at the results of girl %s." % girl_id)

def vote(request, girl_id):
    return HttpResponse("You're voting on girl %s." % girl_id)
    # Create your views here.
